﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<!--[if lt IE 9]>
      <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
<title>我的订单</title>
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet"	href="${ctx }/plugin/bootstrap/3.3.5/css/bootstrap.min.css">

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="${ctx }/resource/plugin/jquery/1.11.3/jquery.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="${ctx }/resource/plugin/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="${ctx }/resource/js/user.js"></script>
<script type="text/javascript">
	var time = 10;
	function returnUrlByTime() {
		window.setTimeout('returnUrlByTime()', 1000);
		time = time - 1;
		if (time <= 0) {
			time = 0;
			window.setTimeout("location.href='${ctx }/userlistOrder.do?userId=${user.id}';", 0);
		}
		document.getElementById("layer").innerHTML = time;
	}
</script>	
</head>

<body onload="returnUrlByTime()">
	<div class="container">
		<div class="row clearfix">
			<div class="col-md-12 column">
				<div class="page-header">
					<h1>
						B2C网上商城 <small>Online Shopping Mall</small>
					</h1>
				</div>
				<ul class="nav nav-pills">
					<li class="active"><a href="${ctx }/welcome.jsp">首页</a></li>
					<li><a href="${ctx }/pages/back/cart/list.action">购物车</a></li>
					<li><c:if test="${user != null }">
							<a href="${ctx }/pages/back/user/findById.action?id=${user.id}" title="${user.name}">用户信息</a>
						</c:if></li>
					<li class="pull-right">
					<c:if test="${user == null }">
							<a href="${ctx }/view/login.jsp">登 录</a>
						</c:if> 
						<c:if test="${user != null }">
								欢迎你，${user.name }  <button type="button"
								class="btn btn-danger btn-sm" onclick="logout()">退出</button>
						</c:if></li>
				</ul>
			</div>
		</div>
		<hr>
		<div class="row clearfix">
			<div class="col-md-12 column">
				<ul class="breadcrumb">
					<li><a href="${ctx }/welcome.jsp">首页</a></li>
					<li>订单</li>
					<li class="active"><c:if test="${user != null }">
							<a href="${ctx }/userlistOrder.do?userId=${user.id}" title="查看">历史订单</a>
						</c:if></li>
				</ul>
				<div style="text-align: center; ">
					<div class="alert alert-success" role="alert">						
						<a href="javascript:void(0)" class="alert-link"
							onclick="window.location.href='${ctx }/userlistOrder.do?userId=${user.id}'">		
							 <span style="font-size: 1.2em;">恭喜你，生成订单成功！						
								<b><span id="layer"  style="color: red;">9</span></b> 秒后会自动跳转，手动跳转，请点这里......
							</span>
						</a>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>